package com.rfid.a252robot.activity.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.rfid.a252robot.R;
import com.rfid.a252robot.base.BaseAdapter;
import com.rfid.db.bean.Book;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class LogAdapter extends BaseAdapter<LogAdapter.ViewHolder, String> {


    public LogAdapter(List<String> data) {
        super(data);
    }

    @Override
    protected void bindView(ViewHolder holder, int position) {
        holder.text.setText(mData.get(position));

    }

    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(android.R.layout.simple_list_item_1,parent,false));
    }

    class ViewHolder extends RecyclerView.ViewHolder {
        @BindView(android.R.id.text1)
        TextView text;
        public ViewHolder(@NonNull View itemView) {
            super(itemView);
            ButterKnife.bind(this,itemView);
        }
    }
}
